<%-- 
    Document   : user_pestanas
    Created on : 10-27-2010, 07:36:01 PM
    Author     : Dada
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="estadocampanas" value="${requestScope.estadocampanas}"/>

<HTML>
<HEAD>
<TITLE>Estado de las Campa&ntilde;a</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="javascript/ext-base.js"></script>
<script type="text/javascript" src="javascript/ext-all.js"></script>

<script type="text/javascript">
        function  clickReporte_Abonado(){
            var hiddenAction=document.getElementById("action");
            hiddenAction.value="reporte_abonado";
        }

        function  clickCrear_Abonado(){
            var hiddenAction=document.getElementById("action");
            hiddenAction.value="crear_abonado";
        }
		function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		butt_01_over = newImage("images/butt_01-over.jpg");
		butt_02_over = newImage("images/butt_02-over.jpg");
		butt_03_over = newImage("images/butt_03-over.jpg");
		butt_04_over = newImage("images/butt_04-over.jpg");
		butt_05_over = newImage("images/butt_05-over.jpg");
		butt_06_over = newImage("images/butt_06-over.jpg");
		preloadFlag = true;
	}
}

var dataEstadoStore;
    Ext.onReady(function(){

        /*Ahora se cargan los stores del segundo Panel: el de resultados de la busqueda*/

        var urlEstadoLlamada="CampanaServlet?action=listaEstadoCampanas";

        var gridEstadoReader = new Ext.data.JsonReader({ root: 'data',
            totalProperty: 'totalCount',
            fields: [
                { name: 'nombre' },
                { name: 'fechainit' },
                { name: 'fechafin' },
                { name: 'nombreEmpleado' },
                { name: 'numlineas' },
                { name: 'prioridad' }

            ]});

        dataEstadoStore = new Ext.data.Store({
            url: urlEstadoLlamada,
            remoteSort: false,
            reader: gridEstadoReader
        });



        dataEstadoStore.on('beforeload', function(store,options) {

               var filtrosBusqueda= {'listacampana' : document.getElementById("idCampana").value  };
                Ext.apply(options.params,filtrosBusqueda);
         });

        var pagingBar = new Ext.PagingToolbar({
            pageSize: 10,
            store: dataEstadoStore,
            displayInfo: true,
            displayMsg: 'Mostrando Campanas {0} - {1} de {2}'
        });

        var gridEstados=new Ext.grid.GridPanel({
            store: dataEstadoStore,
            columns: [
                {
                    header: 'Nombre', sortable:true,dataIndex:'nombre',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;

                            }
                },
                {
                    header: 'Fecha de Inicio', sortable:true,dataIndex:'fechainit',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;

                            }
                },
                {
                    header: 'Fecha de Fin', sortable:true, dataIndex:'fechafin',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;
                            }
                },
                {
                    header: 'Empleado', sortable:true, dataIndex:'nombreEmpleado',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;
                            }
                },
                {
                    header: 'N. de Lineas', sortable:true, dataIndex:'numlineas',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;
                            }
                },
                {
                    header: 'Prioridad', sortable:true, dataIndex:'prioridad',width:110,renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                                metaData.css = 'multilineColumn'; return value;
                            }
                }
            ],
            bbar: pagingBar,
            loadMask: true,
            frame: false,
            viewConfig: {
              forceFit: true
            }
        });

        var panelGrid=new Ext.Panel({
            width:700,
            height:300,
            layout: 'fit',
            items: [gridEstados],
            autoScroll:true
        });

         var panelBusqueda = new Ext.FormPanel
         ({
                    renderTo: 'gridEstados',
                    layout: 'anchor',
                    frame:true,
                    monitorValid:true,
                    title: 'Resultados de la Busqueda',
                    width: 700,
                    items: [panelGrid]
         });

        dataEstadoStore.load({params: {start: 0, limit:10}});

   });

    </script>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

<link href="general.css" rel="stylesheet" type="text/css">
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css">

</HEAD>
<BODY BGCOLOR=#133F54 ONLOAD="preloadImages();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
  <TABLE WIDTH=1191 BORDER=1 CELLPADDING=0 CELLSPACING=0>
    <TR>
      <TD width="178" height="218" align="center" valign="middle" class="logo"><p><strong>Chasqui-soft</strong></p>
      <p><img src="images/defaultlogo.gif" width="48" height="48" alt="logo"></p></TD>
      <TD width="1007" align="left" valign="top"><img src="images/callcenter_banner.jpg" width="1009" height="216" alt="banner"></TD>
    </TR>
    <TR>

      <TD height="152"><img src="images/info_area.jpg" alt="back" width=178 height=270></TD>
      <TD rowspan="3" align="center" valign="top"><table width="982" height="293" border="0" cellspacing="0">
         <tr>
              <td><p class="ruta">>Administración>Usuario>Reportes>Estado Campaña</p></td>
              <tr>
          <td width="980" height="293" align="center" valign="top" scope="col"><p>&nbsp;</p>
            <p class="Titlulos_General">Estado de las Campa&ntilde;as</p>
            <p class="Titlulos_General"><img src="images/t_19.jpg" width="500" height="2" alt="serparador"></p>
            <TABLE border="0" cellPadding="0" cellSpacing="0" width="750">
              <TR>
                
                </TR>
              <TR>
                <td valign="top">              
              <TR>
                <td valign="top" class="texto">Lista de Campa&ntilde;as:<TR>
                
                <td width="1097" align="center" valign="top"><%-- ESPACIO DE PRUEBA --%>
                  
  
                  <p>&nbsp;</p>
                  <input type="hidden" id="idCampana" value="${requestScope.idCampana}">
                  <div id="gridEstados"></div>
 <!--table width="1003" height="129" border="1">
  <tr class="Titulos_texto">
    <td width="148" height="67"><div align="center" class="Titulos_texto">Nombre</div></td>
    <td width="151"><div align="center" class="Titulos_texto">Fecha Inicio</div></td>
    <td width="149"><div align="center" class="Titulos_texto">Fecha Fin</div></td>
    <td width="204"><div align="center" class="Titulos_texto">Empleado</div></td>
    <td width="160"><div align="center" class="Titulos_texto">N&deg; de L&iacute;neas</div></td>
    <td width="151"><div align="center" class="Titulos_texto">Prioridad</div></td>
  </tr>
  <form action="CampanaServlet?action=estadocampana" method="POST">
  <c:forEach var="estadocampanas" items="${requestScope.estadocampanas}">
  <tr class="tablas">
    <th height="42">${estadocampanas.nombre}</th>
    <th>${estadocampanas.fechainit}</th>
    <th>${estadocampanas.fechafin}</th>
    <th>${estadocampanas.empleado.nombre}</th>
    <th>${estadocampanas.numlineas}</th>
    <th>${estadocampanas.prioridad}</th>
  </tr>
    
  </c:forEach>
  </form>
  </table-->
  
                  
                  <%-- ESPACIO DE PRUEBA --%>
                  
                  
                  
                  
            </TABLE></td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <table width="300" border="0" cellspacing="0">
        <tr>
          <th scope="row"><span class="Titlulos_General"><img src="images/t_19.jpg" width="500" height="2" alt="serparador"></span></th>
        </tr>
      </table>
      <p>&nbsp;</p></TD>
    </TR>
    <TR>

      <TD width="178" height="208" valign="top" bgcolor="#E4560B"><ul id="MenuBar1" class="MenuBarVertical">
        <li><a href="index2.jsp">Home</a>          </li>
        <li><a href="clientes2.jsp">Clientes</a></li>
        <li><a href="usuario2.jsp" class="MenuBarItemSubmenu">Administraci&oacute;n</a>
          <ul>
            <li><a href="AbonadoServlet">Abonados</a></li>
            <li><a href="CampanaServlet">Campa&ntilde;as</a></li>
            <li><a href="modificar_usuario.jsp">Empleados</a></li>
            <li><a href="ReportesServlet?action=listreportes">Reportes</a></li>
           	<li><a href="CampanaServlet?action=volverusuario">Cerrar Sesi&oacute;n</a></li>
          </ul>
        </li>
        <li><a href="noticias2.jsp">Noticias</a></li>
        <li><a href="soporte2.jsp">Soporte</a></li>

        <li><a href="contactanos2.jsp">Cont&aacute;ctanos</a></li>
</ul></TD>
    </TR>
    <TR>
      <TD height="169" valign="top"><img src="images/info_area.jpg" alt="back" width=178 height=270></TD>
    </TR>
  </TABLE>
</div>
<!--Jansondesigns.com offers an impressive collection of professionally made web templates, banner templates,
flash designs, free templates and free web graphics. We have templates that suit any personal or professional web site needs!! -->

<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</BODY>
</HTML>